<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>资产管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		
		function deleteWR(rfid,roleId){
			//alert(roleId);
			if(confirm("确定要删除rfid信息吗?")){
				$.ajax({
		            type:"POST",
		            url:'${ctx}/guobo/warnroleRfid/deleteWarningRoleRfid',
		            data:{rfid:rfid,warningRole:roleId},
		            //返回数据的格式
		            datatype: "json",
		            success:function(data){
		            	$.jBox.alert('保存成功!', '提示!');
		            	location.reload();
		            },
		            //调用出错执行的函数
		            error: function(){
		            	$.jBox.alert('保存失败!', '提示!');
		            }         
		         });
			}
		}
	</script>
</head>
<body>
	<form:form id="searchForm" modelAttribute="warningRole" action="${ctx}/guobo/warningRole/findListByWarnroleId" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<input type="hidden" id="roleId" value="${warningRole.id }">
		<form:hidden path="id"/>
		<ul class="ul-form">
			<li><label>RFID：</label>
				<%-- <form:input path="model" htmlEscape="false" maxlength="64" class="input-medium"/> --%>
				<input type="text" id="rfid" name="rfid" value="${rfid }" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
				<tr>
					<th>序号</th>
					<th>RFID</th>
					<th>资产名称</th>
					<shiro:hasPermission name="guobo:warningRole:edit"><th>操作</th></shiro:hasPermission>
				</tr>
		</thead>
		<tbody>
		<c:forEach items="${roleRfids}" var="roleRfid" varStatus="vs">
					<tr>
						<td>${vs.index+1}</td>
						<td>${roleRfid.asset.rfid}</td>
						<td>${roleRfid.asset.name}</td>
						<shiro:hasPermission name="guobo:warnroleRfid:edit"><td>
							<input id="btnSubmit" class="btn btn-primary" type="button" value="删 除" onclick="deleteWR('${roleRfid.asset.rfid}','${warningRole.id}')"/>
						</td></shiro:hasPermission>
					</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>